home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Run Magazine ReRun 1988 May & June
/
rerun-1988-05-06.d64
/
math whiz
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
4KB
|
136 lines
0 rem******** math whiz **************** ******by dan campbell**************
3 poke53280,0:poke53281,0
5 dimn$(81):dims$(3)
7 gosub1300:gosub1000
9 x=rnd(-ti)
100 poke53281,0:r=r+1:ifr>15then1200
110 print"[147][159]score: "sc"[157] "
120 a=int(rnd(1)*10)
130 a1$=n$(a)
140 b=int(rnd(1)*9)+1
150 b1$=n$(b)
160 x=a+b
170 y=a*b
180 c1$=n$(x)
190 c2$=n$(y)
200 poke198,0
300 si=val(si$)-1:onsi+1goto400,500,400,500,310,320
310 si=int(rnd(1)*2):goto330
320 si=int(rnd(1)*4)
330 onsi+1goto400,500,400,500
400 ti$="000000"
405 print""a1$s$(si)b1$e$er$
410 gosub600
415 getx$:ifx$=""then410
420 ifasc(x$)=13then700
425 ifx$<"0"orx$>"9"then410
430 print""tab(24)n$(val(x$))
435 gosub600
440 gety$:ify$=""then435
445 ifasc(y$)=20then405
450 ifasc(y$)=13then700
455 ify$<"0"ory$>"9"then435
460 print""tab(28)n$(val(y$))
465 gosub600
470 getz$:ifz$=""then465
475 ifasc(z$)=20then405
480 ifasc(z$)=13then700
485 goto465
500 ti$="000000"
505 ifsi=3then515
510 print""c1$s$(si)b1$e$er$:goto520
515 print""c2$s$(si)b1$e$er$
520 gosub600
525 getx$:ifx$=""then520
530 ifasc(x$)=13thengoto700
535 ifx$<"0"orx$>"9"then520
540 print""tab(28)n$(val(x$))
545 gosub600
550 gety$:ify$=""then545
555 ifasc(y$)=20then505
560 ifasc(y$)=13then700
565 goto545
600 tm=15-val(ti$)
610 iftm>9thenprint""tab(19)tm
620 iftm<10thenprint""tab(20)tm
630 iftm=0then800
640 return
700 onsigoto720,730,740
710 ifval(x$+y$)=xthen900
715 goto800
720 ifval(x$)=athen900
725 goto800
730 ifval(x$+y$)=ythen900
735 goto800
740 ifval(x$)=athen900
745 goto800
800 print"wrong!":sc=sc-250:f=1
805 print"[158] [157][157][157][157][157][157][157][157][157][157][157][157] "
810 print" [145][157][157][157][157][157][157][157][157][157][157][157][157]";:gosub850
815 print"[159]score: "sc"[157] "
820 pokes+4,33:pokes+1,6:pokes,71:fori=1to400:next:pokes+1,4:pokes,112
825 fori=1to750:next:pokes+1,0:pokes,0:fori=1to3500:next:pokes+4,17:goto100
850 onsigoto860,865,870
855 printa"+"b"="x:return
860 printx"-"b"="a:return
865 printa"x"b"="y:return
870 printy"/"b"="a:return
900 print"that's right!":c=1:f=0
910 p=int((900-ti)/2):sc=sc+p
920 print"[159]score: "sc"[157] "
930 restore
940 fori=1to9:readh,l,t
950 pokes+1,h:pokes,l:fory=1tot:next:pokes,0:pokes+1,0:poke53281,c:c=c+1
960 next
970 goto100
1000 n$(0)="[169] [223][157][157][157] [157][157][157] [157][157][157] [157][157][157] [157][157][157][146][223] [146][169][145][145][145][145][145]"
1010 n$(1)="[169] [157] [157] [157] [157] [157][157] [145][145][145][145][145]"
1020 n$(2)="[169] [223][157][157][157] [157][157][169][146][169][157][157][157][169][146][169][157][157] [157] [145][145][145][145][145]"
1030 n$(3)="[169] [223][157][157][157] [157][157][146][162][169][157][157][162][223][157][157][157][146][162] [157][157][157][146][223] [146][169][145][145][145][145][145]"
1040 n$(4)=" [146][182][182][157][157][157] [146][182][182][157][157][157] [157][157][146][182][182][157][157][146][182][182][157][157][146][182][182][145][145][145][145][145]"
1050 n$(5)=" [157][157][157] [157] [223][157] [157][157][157][184] [157][157][157][146][223] [146][169][145][145][145][145][145]"
1060 n$(6)="[169] [223][157][157][157] [162][157][157][157] [223][157][157][157] [157][157][157] [157][157][157][146][223] [146][169][145][145][145][145][145]"
1070 n$(7)=" [157][157][157][162] [157][157][169][146][169][157][157] [157] [157] [145][145][145][145][145]"
1080 n$(8)="[169] [223][157][157][157] [157][157][157][146][223][162][169][157][157][157][169][162][223][157][157][157] [157][157][157][146][223] [146][169][145][145][145][145][145]"
1090 n$(9)="[169] [223][157][157][157] [157][157][157] [157][157][157][146][223] [157][157][157][184] [157][157][157][146][223] [146][169][145][145][145][145][145]"
1100 fori=10to81:n$(i)=n$(int(i/10))+n$(i-(int(i/10)*10)):next
1110 r$=" [157][157][157][157][157][157][157]":fori=1to6:er$=er$+r$:next
1120 s$(0)="[146][186][204][157][157][208][207][145][145][145]"
1130 s$(1)="[146][164][164][157][157][163][163][145][145][145]"
1140 s$(2)="[146][205][206][157][157][206][205][145][145][145]"
1150 s$(3)="[146][209][157][157][195][195][195][157][157][209][145][145][145][145]"
1160 e$="[146][192][192][157][157][192][192][145][145][145]"
1170 return
1200 print"[147][159]score: "sc"[157] "
1210 l1=27:iff=1thenrestore:l1=36
1220 fori=1tol1:readh,l,t
1230 pokes+1,h:pokes,l:fory=1tot+20:next
1240 pokes+1,0:pokes,0:next
1260 print"[158] to play again[157][157][157][157][157][157][157][157][157]press[157][157][157]a[146]"
1270 getf$:iff$<>"a"then1270
1280 gosub1325:goto100
1300 print"[147][159]****************math whiz[146]***************"
1310 print" press any key":print" to begin"
1320 getg$:ifg$=""then1320
1325 print"[147][159]1[146] add"
1330 print"2[146] subtract"
1335 print"3[146] multiply"
1340 print"4[146] divide"
1345 print"5[146] add & subtract"
1350 print"6[146] all functions"
1355 print:print:input"";si$
1360 s=54272:fori=stos+24:pokei,0:next:pokes+5,96
1365 pokes+6,255:pokes+24,15:pokes+4,17
1370 sc=0:r=0
1375 ifval(si$)=>1andval(si$)<=6then1385
1380 goto1325
1385 return
1500 data50,60,100,50,60,100,50,60,100,50,60,200,63,75,100
1510 data75,69,100,75,69,100,63,75,100,50,60,200
1520 data50,60,100,56,99,100,56,99,100,56,99,100,56,99,200
1530 data50,60,100,47,107,100,47,107,100,42,62,100,37,162,300
1540 data50,60,100,50,60,100,50,60,100,50,60,200
1550 data63,75,100,75,69,100,75,69,100,63,75,100,50,60,200
1560 data50,60,100,56,99,200,56,99,100,37,162,100
1570 data42,62,100,47,107,100,50,60,500,50,60,400